<?xml version="1.0" encoding="UTF-8"?>
<jsp:root 	xmlns:jsp="http://java.sun.com/JSP/Page"
			xmlns:c="http://java.sun.com/jsp/jstl/core" 
			xmlns="http://www.w3.org/1999/xhtml"
			version="2.1">
	<jsp:directive.page contentType="text/html; charset=UTF-8" />
	<jsp:directive.page isELIgnored="false" />
	<jsp:output 	omit-xml-declaration="false" 
 			 		doctype-root-element="HTML" 
 					doctype-system="about:legacy-compat" />
<html>
<head>

<link rel="shortcut icon" href="${pageContext.request.contextPath }/img/favicon.png" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

<title>Ikex</title>

<link rel="stylesheet"
	href="${pageContext.request.contextPath }/css/estilos.css"
	type="text/css" media="screen" charset="utf-8" />
	
	<link rel="stylesheet"
	href="${pageContext.request.contextPath }/css/menuLateral.css"
	type="text/css" media="screen" charset="utf-8" />


<meta name="description" content="" />
<meta name="author" content="Emilio Javier Castillo Gonzalez" />

<script type="text/javascript" language="javascript" src="${pageContext.request.contextPath }/js/login/login.js">
<!-- a -->
</script>

<script type="text/javascript" language="javascript" src="${pageContext.request.contextPath }/js/cookies/verCookies.js">
<!-- a -->
</script>

<script type="text/javascript" language="javascript" src="${pageContext.request.contextPath }/js/login/login.js">
<!-- a -->
</script>
</head>

<link href="${pageContext.request.contextPath }/js/paginador/animate.css" rel="stylesheet" type="text/css" >
<!-- A -->
</link>
<script src="${pageContext.request.contextPath }/js/paginador/jquery-1.8.2.min.js" type="text/javascript">
<!-- A -->
</script>
<script src="${pageContext.request.contextPath }/js/paginador/jPages.min.js" type="text/javascript">
<!-- A -->
</script>
<script src="${pageContext.request.contextPath }/js/paginador/Pagination.js" type="text/javascript">
<!-- A -->
</script>

<link href="${pageContext.request.contextPath }/js/paginador/style.css" rel="stylesheet" type="text/css">
<!-- A -->
</link>
<body>

<jsp:useBean id="productos"	class="es.ikex.beans.ListaTipoProductosBean" scope="session" /> 
<c:if test="${param.coleccion != null and param.coleccion != '' }">
<jsp:setProperty name="productos" property="clausulaWhere" value="where NombreCategoria='${param.categoria }' AND NombreColeccion='${param.coleccion }'"/>
</c:if>

<c:if test="${param.coleccion == null or param.coleccion == '' }">
<jsp:setProperty name="productos" property="clausulaWhere" value="where NombreCategoria='${param.categoria }'"/>
</c:if>


<c:import url="${pageContext.request.pathInfo}/jsp/menuLateral.jsp" />
<c:import url="${pageContext.request.pathInfo}/jsp/cabecera.jsp" />
	<div id="contenedor">


		<div id="contenido">

		<c:url var="destino" value="${pageContext.request.pathInfo}/Controlador/procesarEleccion.jsp">
			<c:param name="dest" value="categoria" />
			<c:param name="categoria" value="${param.categoria}" />
		</c:url>
		Categorias > <a  style="margin: 0px" href="${destino}">${param.categoria}</a>
		<c:if test="${param.coleccion != null and param.coleccion != '' }"> > ${param.coleccion}</c:if>
			<div id="centro">
			<form>
				<div style="float: right;">
			        <label>
			            Elementos por pagina:
			        </label>
			        <select id="Itemsperpage">
			        	<option>3</option>
			            <option selected="selected">6</option>
			            <option>9</option>
			            <option>12</option>
			        </select>
		        </div>
		    </form>
		    <div style="clear: both;"><!-- A --></div>
			<ul id="itemContainer" style="list-style: none;">
				<c:forEach items="${productos.where }" var="producto" varStatus="contador">
				<li>
					<div style="border-bottom: 1px solid #DFDFDF;padding: 15px; margin: 15px; width: 20%; float: left; height: 300px;">
						<div style="border-bottom: 1px;">
						<c:url var="ir" value="${pageContext.request.pathInfo }/jsp/detallesMuebles.jsp">
							<c:param name="codigo" value="${producto.codigo}" />
							<c:param name="categoria" value="${param.categoria }" />
							<c:param name="coleccion" value="${param.coleccion }" />
							<c:param name="foto" value="${producto.foto }" />
						</c:url>
						<a href="${ir}" ><img alt="foto-mueble" src="${pageContext.request.contextPath }/img/muebles/${producto.foto }" style="max-height: 170px; max-width: 100%"/></a>
						</div>
						<div>
						<p>${producto.concepto } <br />
						<c:if test="${producto.stock != null and 5 >= producto.stock}">
						<c:choose>
							<c:when test="${1==producto.stock }">
								ULTIMO PRODUCTO EN STOCK!!!!
							</c:when>
							<c:when test="${1>producto.stock }">
								Fuera de stock<br />
							</c:when>
							<c:otherwise>
								Solo quedan ${producto.stock } productos en stock.<br />
							</c:otherwise>
						</c:choose>
							
						</c:if>
						
						<a href="${ir}" ><img alt="comprar" src="${pageContext.request.contextPath }/img/carrito/shopping-cart_add.png" height="45px"/></a>
						 ${producto.precio }€</p>
						</div>
					</div>
					</li>
				</c:forEach>
				</ul>
				<div style="clear: both;"><!-- A --></div>
				<p id="legend2">
		        <!-- A -->
		        </p>
		        <div class="holder" style="margin: 0 auto; width: 200px;">
		        <!-- A -->
		        </div>
			</div>
			
			<div id="der"></div>

		</div>
		<div style="clear: both;"></div>
	
	
	</div>
</body>
</html>
</jsp:root>